package com.tool4j.common;

import lombok.Getter;

/**
 * 缺陷状态枚举类
 *
 * @author Deng.Weiping
 * @since 2023/8/7 8:40
 */
@Getter
public enum IssueEnum {

    NEW("新建", "new"),
    WORKING("处理中", "working"),
    CLOSED("已解决", "closed"),
    REJECT("不予处理", "reject");

    /**
     * 缺陷状态
     */
    private String value;

    /**
     * 中文描述
     */
    private String name;

    public static String getNameByValue(String value) {
        for (IssueEnum issueEnum : IssueEnum.values()) {
            if (issueEnum.getValue().equals(value)) {
                return issueEnum.name();
            }
        }
        return null;
    }

    IssueEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }
}
